智简魔方文档

服务器列表

本文说明智简魔方 DCIM 系统中“服务器列表”相关的接口或函数信息,供开发人员在集成、调用和排查问题时参考。

概述

查询系统下的所有符合条件的服务器硬件信息

URL

/index.php?m=api&a=hardwareListing

请求参数

字段名变量名必填类型描述
搜索类型searchstring搜索类型(house:机房 ID,cabinet:机柜 ID,power:电源状态,key:IP 或者物理标签或者内部标签,highgrade:高级搜索,special:特殊搜索)
搜索内容keystring对服务器硬件信息的搜索,搜索类型为 house 时,调用/index.php?m=api&a=getHouse 获取由 id(机房 ID)和 name(机房名称)组成的二维数组,选择传递 ID;搜索类型为 cabinet 时,调用/index.php?m=api&a=getCabinet 获取由 id(机柜 ID)和 name(机柜名称)组成的二维数组,选择传递 ID;搜索类型为电源状态时,选择(on:开机,off:关机,error:未知)其一传递;
分页数量listpagesint每一页显示的数据的数量
排序类型orderbystring用来排序的字段
排序规则sortingstring升序 asc 降序 desc
数据偏移量offsetint返回数据的偏移指针,与分页数量结合使用
服务器类型typestring搜索的服务器类型,(1:租用,2:自用,5:托管)
cpucpuarray高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),CPU 的 ID,调用/index.php?m=api&a=getCpu 获取由 id(CPU ID)和 name(CPU 名称)组成的二维数组
cpu 数量cpu_numint高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),CPU 数量
内存ramarraysearch 为 special 时为二维数组高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),内存 ID,调用/index.php?m=api&a=getRam 获取由 id(内存 ID)和 name(内存名称)组成的二维数组
内存数量ram_numsearch为highgrade时为int
search为special时为array
高级/特殊搜索参数(search的值为highgrade或special时使用),内存数量
search为special时,ram数组和ram_num数组的值根据下标一一对应代表搜索x个a/c,y个b/d
硬盘diskarraysearch 为 special 时为二维数组高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),硬盘 ID,调用/index.php?m=api&a=getDisk 获取由 id(硬盘 ID)和 name(硬盘名称)组成的二维数组
硬盘数量disk_numsearch为highgrade时为int
search为special时为array
高级/特殊搜索参数(search的值为highgrade或special时使用),硬盘数量
search为special时,disk数组和disk_num数组的值根据下标一一对应代表搜索x个a/c,y个b/d
PCIpciarraysearch 为 special 时为二维数组高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),PCI ID,调用/index.php?m=api&a=getPci 获取由 id(PCI ID)和 name(PCI 名称)组成的二维数组
PCI数量pci_numsearch为highgrade时为int
search为special时为array
高级/特殊搜索参数(search的值为highgrade或special时使用),硬盘数量
search为special时,pci数组和pci_num数组的值根据下标一一对应代表搜索x个a/c,y个b/d
ipipstring高级搜索参数(search 的值为 highgrade 时使用),IP 地址
ip 数量ip_numint高级搜索参数(search 的值为 highgrade 时使用),IP 数量
内存容量ram_capacityint特殊搜索参数(search 的值为 special 时使用),内存容量
过滤规则filterint特殊搜索参数(search 的值为 special 时使用),0:一致,1:包含

返回参数

字段名变量名类型描述
服务器硬件列表listingarray
id 服务器硬件id
wltag 物理标签
nbtag 内部标签
cpu 一维数组(name:cpu名称,num:cpu数量)
ram 二维数组(name:内存名称,num:内存数量)disk 二维数组(name:硬盘名称,num:硬盘数量)pci 二维数组(name:pci名称,num:pci数量)time 上架时间
serverid 服务器软件IDstype 类型(1租用,2自用,5托管,8机柜客户)power 电源状态(error:错误,on:开机,off:关机,nonsupport:不支持)
intranet_id 内网IDlock 锁定mac(0:不锁定,1:锁定)mac mac地址ipmi_name ipmi用户名ipmi_pass ipmi密码power_msg 电源状态信息zhuip 主IPsubnetmask 子网掩码gateway 网关ipmi_ip IPMI IPvlan 连接交换机可用vlanswitch_id 连接交换机idswitch_num 连接交换机端口号switch_num_name 连接交换机端口号名称in_bw 连接交换机端口入口带宽out_bw 连接交换机端口出口带宽vlanid 连接交换机端口vlanport_mac 连接交换机端口mac地址(数组)mac_diff mac地址和交换机端口mac地址是否不同(0:相同。1:不同)typename 硬件型号名称pid 连接PDU设备ID
pdu 连接PDU设备名称
pdu_num 连接PDU设备端口showtype pdu端口显示类型(0:数字,1:字母)ipmi_support 支持IPMI控制(true,false)cid 所属机柜ID
cname 所属机柜名称house 机房idhouse_name 机房名称osname 操作系统os_id 操作系统idos_group_id 操作系统分组idosusername 系统账号ospassword 系统密码sum 分配ip总数ip 分配ip(数组)
根据查询条件查询到的所有服务器硬件数据
服务器内网intranetServerarray
id 服务器id
wltag 服务器物理标签
服务器内网,数组下标为服务器软件ID
服务器连接交换机switcharray
sid 交换机ID
sname 交换机名称
switch_num 交换机端口号
服务器连接交换机,数组下标为服务器硬件ID
服务器总数sumint系统内服务器硬件数据的总数
分页数量listpagesint每一页显示的数据的数量
搜索类型searchstring搜索类型
搜索内容keystring自定义的搜索内容
排序类型orderbystring用来排序的字段
排序规则sortingstring升序 asc 降序 desc
数据偏移量offsetint返回数据的偏移指针,与分页数量结合使用
服务器类型typestring搜索的服务器类型
状态statusstringsuccess 成功 error 失败

0